<?php
namespace app\baseinfo\model;
use \think\Model;

class Customer extends \app\common\model\Base {
	protected $table='xl_customer';

  protected $_AllowPreprocess=true;
  protected $_AllowSiteInsulate=false;

  //protected $visible=['name','description'];
  protected $append=['location'];

  protected function preprocess(&$param) {
    unset($param['open_id']);
    unset($param['total_point']);
    unset($param['balance']);
    return true;
  }

  protected function getLocationAttr($val,$data) {
    if (isset($data['location_id'])) {
      if ($tmp = model('Area')->get($data['location_id']))
      return $tmp ->getAttr('full_name');
    } else {
      return null;
    }
  }
  // protected function getBirthAttr($val) {
  //   return date('YY-mm-dd',$val);
  // }
}

?>